package com.daxia.bumall.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.daxia.bumall.event.SpecificationChangedEvent;

@Service
public class EventDispather {
	@Autowired
	private ApplicationContext applicationContext; 
	
	/**
	 * 规格有变动，更新图片和编码
	 * @param productId
	 */
	@Transactional
	public void specificationChanged(Long productId) {
		applicationContext.publishEvent(new SpecificationChangedEvent(productId));
	}
	
}
